package run.siyuan.jdk.设计模式.模板模式.模板模式案例3;

/**
 * @className: HummerH1Model
 * @Description: TODO 模板模式-扩展悍马1
 * @author: siyuan
 * @date: 2022/3/17 10:18 AM
 */
public class HummerH1Model extends HummerModel {
    private boolean alarmFlag = true;  //要响喇叭

    protected void alarm() {
        System.out.println("悍马H1鸣笛...");
    }

    protected void engineBoom() {
        System.out.println("悍马H1引擎声音是这样的...");
    }

    protected void start() {
        System.out.println("悍马H1发动...");
    }

    protected void stop() {
        System.out.println("悍马H1停车...");
    }

    protected boolean isAlarm() {
        return this.alarmFlag;
    }

    //要不要响喇叭，是由客户来决定的
    public void setAlarm(boolean isAlarm) {
        this.alarmFlag = isAlarm;
    }
}